﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using System.Web.SessionState;
using Hjp.FrameWork.Common;
using Wjtour.BLL;
using Wjtour.Common;

namespace Wjtour.Web.Front
{
    /// <summary>
    /// Summary description for login
    /// </summary>
    public class sceneresturant : IHttpHandler, IRequiresSessionState
    {
        #region 固定分页参数
        private int page = 1;
        private int pagesize = 12;
        #endregion

        sceneresturant_bll _bll = new sceneresturant_bll();
        protected PaginationData<Wjtour.Domain.resturant> data = new PaginationData<Domain.resturant>();
        private int sceneid = 0;

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";

            page = Utils.StrToInt(context.Request["page"], 1);
            sceneid = Utils.StrToInt(context.Request["sceneid"], 0);
            data = _bll.GetList(sceneid, page - 1, pagesize);
            data.PagnationHtml = Utility.GetAjaxPageHtml("sceniclist.aspx", page, data.Pager.TotalPages);

            JavaScriptSerializer serialzier = new JavaScriptSerializer();
            string output = serialzier.Serialize(data);
            context.Response.Write(output);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}